Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

310
Views
How to perform a "NOT IN" query in mongodb without using $nin?

I need an alternative to $nin in mongodb. As we know, we can achieve the "IN" query operation by performing "OR" query as well.

In the same way, how can I achieve "NOT IN" functionality in mongodb without using $nin ? What are the alternatives to using $nin in mongodb to acheive exactly same results ?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Well, interesting, But I think It can be achieved by $not

say you have $nin for A,B and C where A,B, C are values which you want to ignore

so instead of calling $nin : [ABC]

what if we call $not : {$or : [A,B,C]}

Update :

Since $not is not working with $or. Maybe you can try $nor which I hope is basically same concept.

over 4 years ago · Santiago Trujillo Report

0

I found that there is a operator $nor which exactly does this function. It works as the negation of $or.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!